﻿using aier.dataaccess.dapper;
using aier.dataaccess.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.business.logic
{
    public class CityBll
    {
        public CityDal cityDal { get; set; }

        /// <summary>
        /// 根据省查所属市 
        /// </summary>
        /// <param name="provinceid">省份ID</param>
        /// <returns></returns>
        public List<CityView> QueryCityByProvinceId(Guid provinceid)
        {
            List<CityView> cityViews = null;
            cityViews = cityDal.QueryCityByProvinceId(provinceid);
            return cityViews;
        }
        /// <summary>
        /// 根据市ID查询市信息
        /// </summary>
        /// <param name="cityid">市ID</param>
        /// <returns></returns>
        public CityView QueryCityById(Guid cityid)
        {
            CityView cityView = null;
            cityView = cityDal.QueryCityById(cityid);
            return cityView;
        }

        public Guid GetCityIdByName(string name)
        {
            return cityDal.GetCityIdByName(name);
        }
    }
}
